package club.beimeng.sendEmail;

import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;

public class BEmail {

    private String title;
    private String content;

    public MimeMessage getMimeMessage(MimeMessage mimeMessage) {
        try{
            if (!title.isEmpty())
                mimeMessage.setSubject(title);
            if (!content.isEmpty())
                mimeMessage.setContent(content,"text/html;charset=UTF-8");
        }catch (Exception e){
            e.printStackTrace();
            return null;
        }
        return mimeMessage;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) { // 设置标题
        this.title = title;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) { // 设置内容
        this.content = content;
    }
}
